package com.ruoyi.easywenku.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ruoyi.common.utils.LongValueSerializer;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 题目对象 awk_question
 *
 * @author yx
 * @date 2020-11-17
 */
@Data
@TableName("awk_question")
public class Question
{
    private static final long serialVersionUID = 1L;

    /** id */
    @Excel(name = "id")
    @JsonSerialize(using = LongValueSerializer.class)

    @TableId(type= IdType.ASSIGN_ID)
    private Long id;

    /** 父id */
    @Excel(name = "父id")
    @JsonSerialize(using = LongValueSerializer.class)
    private Long pId;

    /** 分类代码 */
    @Excel(name = "分类代码")
    private String typeCode;

    /** 科目 */
    @Excel(name = "科目")
    private String course;

    /** 题目 */
    @Excel(name = "题目")
    private String questionBody;

    /** 题目类型 */
    @Excel(name = "题目类型")
    private String questionType;

    /** 选项 */
    @Excel(name = "选项")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object questionOption;

    /** 参考答案 */
    @Excel(name = "参考答案")
    private String answer;

    /** 答案解析 */
    @Excel(name = "答案解析")
    private String answerAnalysis;

    /** 备注1 */
    @Excel(name = "备注1")
    private String remarks1;

    /** 备注2 */
    @Excel(name = "备注2")
    private String remarks2;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("pId", getPId())
            .append("typeCode", getTypeCode())
            .append("course", getCourse())
            .append("questionBody", getQuestionBody())
            .append("questionType", getQuestionType())
            .append("option", getQuestionOption())
            .append("answer", getAnswer())
            .append("answerAnalysis", getAnswerAnalysis())
            .append("remarks1", getRemarks1())
            .append("remarks2", getRemarks2())
            .toString();
    }
}
